DEW.CategoriesCollection = Backbone.Collection.extend({
   url: function() {
       return DEW.appURL + '/categories?keycode='+DEW.keycode;
   },

    parse : function(response){
        if(!response.success){
            if (response.invalidKeycode) {
                alert("CategoriesCollection:"+response.message);
                window.location.replace(DEW.appURL + "/login");
                return false;
            }
           alert(response.message || 'Error obteniendo categorias');
        } else {
            this.trigger('data-loaded', response.data);
        }
        return response.data;
    }

});
